#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// This test checks the Sea Hag Card (card enum 25)
int main()
{
	int k[10] = {great_hall, gardens, embargo, village, minion, mine, cutpurse, sea_hag, tribute, smithy};
	struct gameState G;
	int randomSeed;
	int m;
	int numPlayer = 4;
	
	srand(time(NULL));
	randomSeed = (rand() % 10)+1;

	m = initializeGame(numPlayer, k, randomSeed, &G);
	
	G.deckCount[1] = 50;
	G.deckCount[2] = 40;
	G.deckCount[3] = 1;
	
	G.deck[1][49] = 2;
	G.deck[2][39] = 2;
	G.deck[3][0] = 2;
	
	seahagCard(0, &G);
	
	printf("Player 1 deck count expected: 50. Actual: %i. ", G.deckCount[1]);
	if(G.deckCount[1] == 50)
		printf("PASSED.\n");
	else
		printf("FAILED.\n");
		
	printf("Player 2 deck count expected: 40. Actual: %i. ", G.deckCount[2]);
	if(G.deckCount[2] == 40)
		printf("PASSED.\n");
	else
		printf("FAILED.\n");
		
	printf("Player 3 deck count expected: 1. Actual: %i. ", G.deckCount[3]);
	if(G.deckCount[3] == 1)
		printf("PASSED.\n");
	else
		printf("FAILED.\n");

	printf("Player two top deck card expected: 25. Actual: %i. ", G.deck[1][G.deckCount[1]-1]);
	if(G.deck[1][G.deckCount[1]-1] == 25)
		printf("PASSED.\n");
	else
		printf("FAILED.\n");
	printf("Player three top deck card expected: 25. Actual: %i. ", G.deck[2][G.deckCount[2]-1]);
	if(G.deck[2][G.deckCount[2]-1] == 25)
		printf("PASSED.\n");
	else
		printf("FAILED.\n");
	printf("Player four top deck card expected: 25. Actual: %i. ", G.deck[3][G.deckCount[3]-1]);
	if(G.deck[3][G.deckCount[3]-1] == 25)
		printf("PASSED.\n");
	else
		printf("FAILED.\n");
	
	return 0;
}